package com.ls.lserp.common.sfprinterCommon;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created by MACHENIKE on 2018/8/21 0021.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Response")
public class SfExpressRequest implements Serializable {

    private static final long serialVersionUID = 1L;
    //响应状态
    @XmlElement(name = "Head")
    private String Head;
    //响应失败原因
    @XmlElement(name = "ERROR")
    private ERROR ERROR;
    //响应结果
    @XmlElement(name = "Body")
    private Body Body;
    @XmlAccessorType(XmlAccessType.NONE)
    public static class ERROR {
        @XmlAttribute(name = "code")
        private String code;
        @XmlValue
        private String text;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    public static class Body {
        @XmlElement(name = "OrderResponse")
        private OrderResponse OrderResponse;
        @XmlElement(name = "RouteResponse")
        private RouteResponse RouteResponse;

        public SfExpressRequest.OrderResponse getOrderResponse() {
            return OrderResponse;
        }

        public void setOrderResponse(SfExpressRequest.OrderResponse orderResponse) {
            OrderResponse = orderResponse;
        }

        public SfExpressRequest.RouteResponse getRouteResponse() {
            return RouteResponse;
        }

        public void setRouteResponse(SfExpressRequest.RouteResponse routeResponse) {
            RouteResponse = routeResponse;
        }
    }

    @XmlRootElement(name="OrderResponse")
    @XmlAccessorType(XmlAccessType.NONE)
    public static class OrderResponse {
        @XmlAttribute(name = "jProvince")
        private String jProvince;

        @XmlAttribute(name = "jCity")
        private String jCity;

        @XmlAttribute(name = "jCountry")
        private String jCountry;

        @XmlAttribute(name = "jaddress")
        private String jaddress;

        @XmlAttribute(name = "jShipperCode")
        private String jShipperCode;

        @XmlAttribute(name = "jCompany")
        private String jCompany;

        @XmlAttribute(name = "jContacts")
        private String jContacts;

        @XmlAttribute(name = "jTelphone")
        private String jTelphone;

        @XmlAttribute(name = "jMobile")
        private String jMobile;

        @XmlAttribute(name = "CLIENTNO")
        private String CLIENTNO;

        @XmlAttribute(name = "CHECKWORDCODE")
        private String CHECKWORDCODE;

        @XmlAttribute(name = "CUSTID")
        private String CUSTID;


        public String getjProvince() {
            return jProvince;
        }

        public void setjProvince(String jProvince) {
            this.jProvince = jProvince;
        }

        public String getjCity() {
            return jCity;
        }

        public void setjCity(String jCity) {
            this.jCity = jCity;
        }

        public String getjCountry() {
            return jCountry;
        }

        public void setjCountry(String jCountry) {
            this.jCountry = jCountry;
        }

        public String getJaddress() {
            return jaddress;
        }

        public void setJaddress(String jaddress) {
            this.jaddress = jaddress;
        }

        public String getjShipperCode() {
            return jShipperCode;
        }

        public void setjShipperCode(String jShipperCode) {
            this.jShipperCode = jShipperCode;
        }

        public String getjCompany() {
            return jCompany;
        }

        public void setjCompany(String jCompany) {
            this.jCompany = jCompany;
        }

        public String getjContacts() {
            return jContacts;
        }

        public void setjContacts(String jContacts) {
            this.jContacts = jContacts;
        }

        public String getjTelphone() {
            return jTelphone;
        }

        public void setjTelphone(String jTelphone) {
            this.jTelphone = jTelphone;
        }

        public String getjMobile() {
            return jMobile;
        }

        public void setjMobile(String jMobile) {
            this.jMobile = jMobile;
        }

        public String getCLIENTNO() {
            return CLIENTNO;
        }

        public void setCLIENTNO(String CLIENTNO) {
            this.CLIENTNO = CLIENTNO;
        }

        public String getCHECKWORDCODE() {
            return CHECKWORDCODE;
        }

        public void setCHECKWORDCODE(String CHECKWORDCODE) {
            this.CHECKWORDCODE = CHECKWORDCODE;
        }

        public String getCUSTID() {
            return CUSTID;
        }

        public void setCUSTID(String CUSTID) {
            this.CUSTID = CUSTID;
        }
    }

    @XmlRootElement(name="RouteResponse")
    @XmlAccessorType(XmlAccessType.NONE)
    public static class RouteResponse {
        //运单号
        @XmlAttribute(name = "mailno")
        private String mailNo;

        //路由
        @XmlElement(name = "Route")
        private List<Route> Route ;

        public String getMailNo() {
            return mailNo;
        }

        public void setMailNo(String mailNo) {
            this.mailNo = mailNo;
        }

        public List<SfExpressRequest.Route> getRoute() {
            return Route;
        }

        public void setRoute(List<SfExpressRequest.Route> route) {
            Route = route;
        }
    }

    @XmlRootElement(name="Route")
    @XmlAccessorType(XmlAccessType.NONE)
    public static class Route {
        //路由节点发生的时间
        @XmlAttribute(name = "accept_time")
        private String acceptTime;

        //路由节点具体描述
        @XmlAttribute(name = "remark")
        private String remark;

        //路由节点操作码
        @XmlAttribute(name = "opcode")
        private String opcode;

        public String getAcceptTime() {
            return acceptTime;
        }

        public void setAcceptTime(String acceptTime) {
            this.acceptTime = acceptTime;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getOpcode() {
            return opcode;
        }

        public void setOpcode(String opcode) {
            this.opcode = opcode;
        }
    }

    public String getHead() {
        return Head;
    }

    public void setHead(String head) {
        Head = head;
    }

    public SfExpressRequest.ERROR getERROR() {
        return ERROR;
    }

    public void setERROR(SfExpressRequest.ERROR ERROR) {
        this.ERROR = ERROR;
    }

    public SfExpressRequest.Body getBody() {
        return Body;
    }

    public void setBody(SfExpressRequest.Body body) {
        Body = body;
    }
}
